/**
 *!
 * \file        b_mod_led_screen.c
 * \version     v0.0.1
 * \date
 * \author      pxc
 *******************************************************************************


/*Includes ----------------------------------------------*/
#include "modules/inc/b_mod_led_screen.h"

#include <string.h>

#include "b_section.h"
#include "core/inc/b_core.h"
#include "core/inc/b_device.h"
#include "hal/inc/b_hal.h"
/**
 * \addtogroup BABYOS
 * \{
 */

/**
 * \addtogroup MODULES
 * \{
 */

/**
 * \addtogroup LED_SCREEN
 * \{
 */

/**
 * \defgroup LED_SCREEN_Private_TypesDefinitions
 * \{
 */

/**
 * \}
 */

/**
 * \defgroup LED_SCREEN_Private_Defines
 * \{
 */
#define setbit(x, n) ((x) |= (1L << (n)))
#define clrbit(x, n) ((x) &= ~(1L << (n)))
#define isbit(byte, bit) ((byte >> bit) & 0x1)
#define NUM_TO_1(num) (num) % 10
#define NUM_TO_2(num) (num / 10) % 10
#define NUM_TO_3(num) (num / 100)
/**
 * \}
 */

/**
 * \defgroup LED_SCREEN_Private_Macros
 * \{
 */

/**
 * \}
 */

/**
 * \defgroup LED_SCREEN_Private_Variables
 * \{
 */

/**
 * \}
 */

/**
 * \defgroup LED_SCREEN_Private_FunctionPrototypes
 * \{
 */

/**
 * \}
 */

/**
 * \defgroup LED_SCREEN_Private_Functions
 * \{
 */

static uint8_t _bButtonRead(void *p)
{
}

static void _bButtonCallback(void *p)
{
}

/**
 * \}
 */

/**
 * \addtogroup LED_SCREEN_Exported_Functions
 * \{
 */
static bLedScreenInstance_t led_screen;

int bLedScreenInit(uint32_t dev_no)
{
    int i             = 0;
    led_screen.dev_no = dev_no;
    bDeviceOpen(led_screen.dev_no);
    // bLedScreenShowNum(56);
    // bLedScreenShowLetter("AD");
    // bHalDelayMs(2000);
    // bLedScreenShowLetter("LA");
    // bHalDelayMs(2000);
    // bLedScreenShowLetter("IN");
    // bHalDelayMs(2000);
    // bLedScreenShowLetter("OP");
    // bHalDelayMs(2000);
    // bLedScreenShowLetter("E2");
    // bHalDelayMs(2000);
    return 0;
}

int bLedScreenShowNum(uint16_t num)
{
    bDeviceWrite(led_screen.dev_no, 0, (uint8_t *)&num, 2);
    return 0;
}
int bLedScreenShowLetter(char *letter)
{
    bDeviceWrite(led_screen.dev_no, 1, (uint8_t *)letter, 2);
    return 0;
}
int bLedScreenShowIcon(uint8_t icon)
{
    bDeviceWrite(led_screen.dev_no, 1, (uint8_t *)icon, 1);
    return 0;
}
/**
 * \}
 */

/**
 * \}
 */

/**
 * \}
 */

/**
 * \}
 */

/************************ Copyright (c) 2019 Bean *****END OF FILE****/
